﻿@model etracks.Web.ProjectInputFormViewModel

@using (Html.BeginForm("Edit", "Project", FormMethod.Post, new { @class = "form-horizontal" }))
{
    <div class="form-group">
        <h3 class="col-sm-offset-2 col-sm-8">Edit project</h3>
    </div>
    
    @Html.Partial("Project_InputFormPartial", Model)

    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-8">
            <button type="submit" class="btn btn-default">
                <span class="glyphicon glyphicon-floppy-disk"></span> Save changes
            </button>

            <button type="button" class="btn btn-default" data-toggle="modal" data-target="#myModal">
                <span class="glyphicon glyphicon-trash"></span> Delete
            </button>

            <a href="@Url.Action("List", "Project")" class="btn btn-default">
                <span class="glyphicon glyphicon-list"></span> Project List
            </a>
        </div>
    </div>
}

<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">Delete Project</h4>
            </div>
            <div class="modal-body">
                <p>Click Cancel to close this dialog.</p>
                <p>Click Delete to delete this project.</p>
            </div>
            <div class="modal-footer">
                
                @using (Html.BeginForm("Delete", "Project", new { id = Model.Id}, FormMethod.Post, new { @class = "form-horizontal" }))
                {
                    <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
                    <button type="submit" class="btn btn-primary">Delete</button>
                }
            </div>
        </div>
    </div>
</div>